package lab01;

/**
 * Created by tianxiadiyishuai on 2017/10/8.
 */
public class Test11 {
    public static void main(String[] args) {
        int count = 0;
        int i;
        for (i = 2; i <= 100; i++) {
            if (isPrimeNumber(i)==true){
                count++;
                System.out.printf("%6d",i);
                if (count%5==0)
                    System.out.println();
            }
        }
    }
    public static boolean isPrimeNumber(int num){
        int k=(int)Math.sqrt(num);
        if (num==2)
            return true;
        for (int i=2;i<k;i++)
            if (num%i==0)
                return false;
        return  true;
    }
}
